namespace HPIT_LiuzuPoint.Entity.POCOModel
{
    using System;
    using System.Data.Entity;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Linq;

    public partial class UserModelEntity : DbContext
    {
        public UserModelEntity()
            : base("name=UserModelEntity")
        {
        }

        public virtual DbSet<Room> Room { get; set; }
        public virtual DbSet<shop> shop { get; set; }
        public virtual DbSet<UserInfo> UserInfo { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Room>()
                .Property(e => e.RoomName)
                .IsUnicode(false);

            modelBuilder.Entity<Room>()
                .HasMany(e => e.UserInfo)
                .WithRequired(e => e.Room)
                .WillCascadeOnDelete(false);

            modelBuilder.Entity<shop>()
                .Property(e => e.shopName)
                .IsUnicode(false);

            modelBuilder.Entity<shop>()
                .Property(e => e.shopType)
                .IsUnicode(false);

            modelBuilder.Entity<shop>()
                .Property(e => e.shopMan)
                .IsUnicode(false);

            modelBuilder.Entity<shop>()
                .Property(e => e.shopPhone)
                .IsUnicode(false);

            modelBuilder.Entity<shop>()
                .Property(e => e.shopAddress)
                .IsUnicode(false);

            modelBuilder.Entity<UserInfo>()
                .Property(e => e.Name)
                .IsUnicode(false);
        }
    }
}
